package com.emcom.gotour.mvc.view;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.emcom.gotour.enums.TourType;
import com.emcom.gotour.po.TourScheduler;
import com.emcom.gotour.vo.TourTypeVO;
import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

public class UpdateTourContentView implements Comparable<Object>, Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 4185116626941319542L;
	private String title;
	private List<TourTypeVO> tourTypeList;
	private List<String> categoryList;
	private List<TourScheduler> schedulerList;
	private GlobalView globalView;
	private NavigationView navigationView;
	private TourContentView tourContentView;
	private SchedulerContentView schedulerContentView;
	public List<TourTypeVO> getTourTypeList() {
		TourType[] tourTypes = TourType.values();
		List<TourTypeVO> tourTypeVOList = new ArrayList<TourTypeVO>();
		for(TourType tourType : tourTypes) {
			TourTypeVO tourTypeVO = new TourTypeVO();
			tourTypeVO.setId(tourType.name());
			tourTypeVO.setName(tourType.value());
			tourTypeVOList.add(tourTypeVO);
		}
		return tourTypeVOList;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public List<String> getCategoryList() {
		return categoryList;
	}
	public void setCategoryList(List<String> categoryList) {
		this.categoryList = categoryList;
	}
	public List<TourScheduler> getSchedulerList() {
		return schedulerList;
	}
	public void setSchedulerList(List<TourScheduler> schedulerList) {
		this.schedulerList = schedulerList;
	}
	public GlobalView getGlobalView() {
		return globalView;
	}
	public void setGlobalView(GlobalView globalView) {
		this.globalView = globalView;
	}
	public NavigationView getNavigationView() {
		return navigationView;
	}
	public void setNavigationView(NavigationView navigationView) {
		this.navigationView = navigationView;
	}
	public TourContentView getTourContentView() {
		return tourContentView;
	}
	public void setTourContentView(TourContentView tourContentView) {
		this.tourContentView = tourContentView;
	}
	public SchedulerContentView getSchedulerContentView() {
		return schedulerContentView;
	}
	public void setSchedulerContentView(SchedulerContentView schedulerContentView) {
		this.schedulerContentView = schedulerContentView;
	}
	public void setTourTypeList(List<TourTypeVO> tourTypeList) {
		this.tourTypeList = tourTypeList;
	}
	/**
	 * @see java.lang.Comparable#compareTo(Object)
	 */
	public int compareTo(Object object) {
		UpdateTourContentView myClass = (UpdateTourContentView) object;
		return new CompareToBuilder()
				.append(this.tourContentView, myClass.tourContentView)
				.append(this.title, myClass.title)
				.append(this.schedulerContentView, myClass.schedulerContentView)
				.append(this.categoryList, myClass.categoryList).append(
						this.globalView, myClass.globalView).append(
						this.tourTypeList, myClass.tourTypeList).append(
						this.schedulerList, myClass.schedulerList).append(
						this.navigationView, myClass.navigationView)
				.toComparison();
	}
	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof UpdateTourContentView)) {
			return false;
		}
		UpdateTourContentView rhs = (UpdateTourContentView) object;
		return new EqualsBuilder().appendSuper(super.equals(object)).append(
				this.tourContentView, rhs.tourContentView).append(this.title,
				rhs.title).append(this.schedulerContentView,
				rhs.schedulerContentView).append(this.categoryList,
				rhs.categoryList).append(this.globalView, rhs.globalView)
				.append(this.tourTypeList, rhs.tourTypeList).append(
						this.schedulerList, rhs.schedulerList).append(
						this.navigationView, rhs.navigationView).isEquals();
	}
	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(821109109, -1168968427).appendSuper(
				super.hashCode()).append(this.tourContentView).append(
				this.title).append(this.schedulerContentView).append(
				this.categoryList).append(this.globalView).append(
				this.tourTypeList).append(this.schedulerList).append(
				this.navigationView).toHashCode();
	}
	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this).append("schedulerContentView",
				this.schedulerContentView).append("schedulerList",
				this.schedulerList).append("tourContentView",
				this.tourContentView).append("globalView", this.globalView)
				.append("tourTypeList", this.tourTypeList).append(
						"navigationView", this.navigationView).append("title",
						this.title).append("categoryList", this.categoryList)
				.toString();
	}
}
